<template>
  <div class="add">
    <el-form :model="ruleForm"
             :rules="rules"
             ref="ruleForm"
             label-width="150px"
             class="demo-ruleForm">
      <el-form-item label="新增密集架数量" prop="name">
        <el-input size="small" v-model="ruleForm.name"></el-input>
      </el-form-item>
      <el-form-item label="每架的列数">
        <el-input size="small" v-model="ruleForm.name"></el-input>
      </el-form-item>
      <el-form-item label="每架的行数">
        <el-input size="small" v-model="ruleForm.name"></el-input>
      </el-form-item>
      <el-form-item label="">
        <el-button type="primary" size="small">保存</el-button>
        <el-button size="small">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'batchDense', // 批量新增
  data () {
    return {
      autosize: {
        minRows: 4,
        maxRows: 6
      },
      value1: '',
      ruleForm: {
        name: ''
      },
      rules: {
        name: [
          {
            required: true,
            message: '请输入活动名称',
            trigger: 'blur'
          },
          {
            min: 3,
            max: 5,
            message: '长度在 3 到 5 个字符',
            trigger: 'blur'
          }
        ]
      }
    }
  },
  methods: {
    submitForm (formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          alert('submit!')
        } else {
          console.log('error submit!!')
          return false
        }
      })
    },
    resetForm (formName) {
      this.$refs[formName].resetFields()
    }
  }
}
</script>

<style lang="scss" scoped>
  .add {
    padding-right: 65px;
  }
</style>
